/*
 * Copyright (c) 2010 CCX(China) Co.,Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * CCX(China) Co.,Ltd. ("Confidential Information").
 * It may not be copied or reproduced in any manner without the express 
 * written permission of CCX(China) Co.,Ltd.
 *
 * Author: cuandm
 * Date: Apr 26, 2011 3:09:49 PM
 */
package com.memcached.utils;


/**
 * @description:配置文件存放数据 实体类
 * @author: cuandm
 * @date： Apr 26, 2011 3:09:49 PM
 * 
 */
public class MemcachedConfigInfo {

	static public String[] getServers() {
		return MemcConfigLoader.getProperty("servers").split(",");
	}

	static public Integer[] getWeights() {
		return IntegerUtils.stringArrConvertIntegerArr(MemcConfigLoader.getProperty(
				"weights").split(","));
	}

	static public int getInitConn() {
		return Integer.parseInt(MemcConfigLoader.getProperty("initConn"));
	}

	static public int getMinConn() {
		return Integer.parseInt(MemcConfigLoader.getProperty("minConn"));
	}

	static public int getMaxConn() {
		return Integer.parseInt(MemcConfigLoader.getProperty("maxConn"));
	}

	static public int getMaxIdle() {
		return Integer.parseInt(MemcConfigLoader.getProperty("maxIdle")) * 1000 * 60 * 60;
	}

	static public int getMaintSleep() {
		return Integer.parseInt(MemcConfigLoader.getProperty("maintSleep"));
	}

	static public boolean getNagle() {
		return Boolean.parseBoolean(MemcConfigLoader.getProperty("nagle"));
	}

	static public int getSocketTO() {
		return Integer.parseInt(MemcConfigLoader.getProperty("socketTO"));
	}

	static public int getSocketConnectTO() {
		return Integer.parseInt(MemcConfigLoader.getProperty("socketConnectTO"));
	}

	static public boolean getCompressEnable() {
		return Boolean.parseBoolean(MemcConfigLoader.getProperty("compressEnable"));
	}

	static public int getCompressThreshold() {
		return Integer.parseInt(MemcConfigLoader.getProperty("compressThreshold")) * 1024;
	}
	
}
